<?php
class episode extends Model
{
    public $id;
	public $programme_id;
	public $onair_episode_no;
	public $first_time_onair;
	public $other_language_episodes;
	public $publish_datetime;
	public $expire_datetime;
	public $country_allow_list;
	public $country_deny_list;
	public $created_at;
	public $modified_at;
	public $main_cast;
	public $side_cast;
	public $host;
	public $guest_host;
	public $guest;
	public $performing_guest;
	public $dancer;
	public $judge;
	public $participant;
	public $executive_producer;
	public $producer;
	public $supervisor;
	public $editor;
	public $story;
	public $dubbing_artiste;
	public $title;
	public $title_zh;
	public $title_en;
	public $description;
	public $description_zh;
	public $description_en;
	public $description_short;
	public $description_short_zh;
	public $description_short_en;
	public $editor_message;
	public $editor_message_zh;
	public $editor_message_en;
	public $rates;

    public static function getTableName()
    {
        return 'episode';
    }

    public function set($obj)
    {
        foreach (get_object_vars($this) as $field=>$value) {
            $this->$field = isset($obj->$field) ? $obj->$field : '';
        }
    }

    public function insert($obj)
    {
        return Model::$dbo['w']->save($obj);
    }

    public function update($obj)
    {
        return Model::$dbo['w']->save($obj);
    }

    public function delete($obj)
    {
        return Model::$dbo['w']->deleteInstance($this->getTableName(),$obj->id);
    }
}
?>
